// penetration.module.js

// 计算无视护甲后巨兽受到的伤害


// [[file:~/literate-programming/soul-hunter-awakening-damage-calculator-web-edition.org::*penetration.module.js][penetration.module.js:1]]
function calculate(object){
    return finalPenetration({
        巨兽护甲:behemothArmor(object.巨兽护甲星级),
        本身护甲穿透:ownArmorPenetration({
            穿透:object.穿透,
            进退:object.进退,
            燃血:object.燃血,
            出战魂:object.出战魂,
            魂萃:object.魂萃,
            羁绊:object.羁绊
        })
    })
}

function finalPenetration(object){
    let 巨兽护甲=object.巨兽护甲
    let 本身护甲穿透=object.本身护甲穿透

    return (200/(200+巨兽护甲*(1-本身护甲穿透)))
}

function behemothArmor(star){
    switch(star){
        case 0:
            /* 百万护甲 */
            return 1000000
        case 0.5:
            return 320
        case 1:
            return 160
        case 2:
            return 80
    }
}

function ownArmorPenetration(object){
    let 穿透=object.穿透
    let 进退=object.进退
    let 燃血=object.燃血
    let 出战魂=object.出战魂
    let 魂萃=object.魂萃
    let 羁绊=object.羁绊

    return (
        穿透+
        进退+
        燃血+
        出战魂+
        魂萃+
        羁绊
    )
}

export{calculate}
// penetration.module.js:1 ends here
